export default {
	data() {
		return {
			// 默认的全局分享内容
			SHARE: {
				title: '夷陵招商',
				path: '/pages/home/home',    // 全局分享的路径，比如 首页
				imageUrl: null,    // 全局分享的图片(可本地可网络)
			}
		}
	},
	methods:{
		OnBack() {
			if (this.ISSUBMIT) return;
			this.ISSUBMIT = true;
			const pages = getCurrentPages();
			if (pages.length === 2) {
				uni.navigateBack({
					delta: 1
				});
			} else if (pages.length === 1) {
				uni.switchTab({
					url: '/pages/index/index',
				})
			} else {
				uni.navigateBack({
					delta: 1
				});
			}
			this.ISSUBMIT = false;
		},
	},
	// 定义全局分享
	// 1.发送给朋友
    onShareAppMessage(res) {
        return {
			title: this.SHARE.title,
			path: this.SHARE.path,
			imageUrl: this.SHARE.imageUrl,
		}
    },
	//2.分享到朋友圈
    onShareTimeline(res) {
        return {
			title: this.SHARE.title,
			path: this.SHARE.path,
			imageUrl: this.SHARE.imageUrl,
		}
    },
}